﻿<div v-if="vmorder.totals != null" class="total-info table-responsive px-0">
    <table class="table table-hover">
        <tbody>
            <tr class="col-12 px-0 order-subtotal d-flex justify-content-start">
                <td class="col-6 cart-total-left">
                    <span>@T("ShoppingCart.Totals.SubTotal"):</span>
                </td>
                <td class="col-6 cart-total-right  text-right">
                    <span class="value-summary">{{vmorder.totals.SubTotal}}</span>
                </td>
            </tr>
            <tr v-if="vmorder.totals.SubTotalDiscount !== null" class="col-12 px-0 order-subtotal-discount d-flex justify-content-start">
                <td class="col-6 cart-total-left">
                    <span>@T("ShoppingCart.Totals.SubTotalDiscount"):</span>
                </td>
                <td class="col-6 cart-total-right  text-right">
                    <span class="value-summary">{{vmorder.totals.SubTotalDiscount}}</span>
                </td>
            </tr>
            <tr class="col-12 px-0 shipping-cost d-flex justify-content-start">
                <td class="col-6 cart-total-left">
                    <span>@T("ShoppingCart.Totals.Shipping"):</span>
                    <span v-if="vmorder.totals.RequiresShipping && vmorder.totals.SelectedShippingMethod !== null" class="selected-shipping-method">@T("ShoppingCart.Totals.Shipping.Method").Text.Replace("{0}", "{{vmorder.totals.SelectedShippingMethod}}")</span>
                </td>
                <td class="col-6 cart-total-right  text-right">
                    <div v-if="vmorder.totals.RequiresShipping">
                        <span v-if="vmorder.totals.Shipping !== null">
                            {{vmorder.totals.Shipping}}
                        </span>
                        <span v-else>
                            @T("ShoppingCart.Totals.CalculatedDuringCheckout")
                        </span>
                    </div>
                    <div v-else>
                        <span>@T("ShoppingCart.Totals.Shipping.NotRequired")</span>
                    </div>
                </td>
            </tr>
            <tr v-if="vmorder.totals.PaymentMethodAdditionalFee !== null" class="col-12 px-0 additional-fees d-flex justify-content-start">
                <td class="col-6 cart-total-left">
                    <span>@T("ShoppingCart.Totals.PaymentMethodAdditionalFee"):</span>
                </td>
                <td class="col-6 cart-total-right text-right">
                    <span class="value-summary">{{vmorder.totals.PaymentMethodAdditionalFee}}</span>
                </td>
            </tr>

            <tr v-if="vmorder.totals.DisplayTaxRates && vmorder.totals.TaxRates[0]" v-for="taxRate in vmorder.totals.TaxRates" class="col-12 px-0 tax-rate d-flex justify-content-start">
                <td class="col-6 cart-total-left">
                    <span>
                        @T("ShoppingCart.Totals.TaxRateLine").Text.Replace("{0}", "{{taxRate.Rate}}")
                    </span>
                </td>
                <td class="col-6 cart-total-right text-right">
                    <span>{{taxRate.Value}}</span>
                </td>
            </tr>
            <tr v-if="vmorder.totals.DisplayTax" class="col-12 px-0 tax-value d-flex justify-content-start">
                <td class="col-6 cart-total-left">
                    <span>@T("ShoppingCart.Totals.Tax"):</span>
                </td>
                <td class="col-6 cart-total-right  text-right">
                    <span class="value-summary">{{vmorder.totals.Tax}}</span>
                </td>
            </tr>
            <tr v-if="vmorder.totals.OrderTotalDiscount !== null" class="col-12 px-0 discount-total d-flex justify-content-start">
                <td class="col-6 cart-total-left">
                    <span>@T("ShoppingCart.Totals.OrderTotalDiscount"):</span>
                </td>
                <td class="col-6 cart-total-right  text-right">
                    <span class="value-summary">{{vmorder.totals.OrderTotalDiscount}}</span>
                </td>
            </tr>
            <tr v-for="gc in vmorder.totals.GiftCards" class="col-12 px-0 giftcard-summary d-flex justify-content-start">
                <td class="col-6 cart-total-left">
                    <span>@T("ShoppingCart.Totals.GiftCardInfo"):</span>
                    <span>@T("ShoppingCart.Totals.GiftCardInfo.Code").Text.Replace("{0}", "{{gc.CouponCode}}")</span>
                    <span class="giftcard-remaining">@T("ShoppingCart.Totals.GiftCardInfo.Remaining").Text.Replace("{0}", "{{gc.Remaining}}")</span>
                </td>
                <td class="col-6 cart-total-right  text-right">
                    <span class="value-summary">{{gc.Amount}}</span>

                    <b-button v-if="vmorder.cart.IsEditable" variant="danger" type="button" name="removegiftcard" id="remove-gift-card-button"  @@click="vmorder.removeGiftCard('/removegiftcardcode?giftCardId=' + gc.Id)">
                        @T("Common.Remove")
                    </b-button>
                </td>
            </tr>
            <tr v-if="vmorder.totals.RedeemedRewardPoints > 0" class="col-12 px-0 reward-points d-flex justify-content-start">
                <td class="col-6 cart-total-left">
                    <span>@T("ShoppingCart.Totals.RewardPoints").Text.Replace("{0}", "{{vmorder.totals.RedeemedRewardPoints}}")</span>
                </td>
                <td class="col-6 cart-total-right  text-right">
                    <span class="value-summary">{{vmorder.totals.RedeemedRewardPointsAmount}}</span>
                </td>
            </tr>
            <tr class="col-12 px-0 order-total d-flex justify-content-start">
                <td class="col-6 cart-total-left">
                    <span>@T("ShoppingCart.Totals.OrderTotal"):</span>
                </td>
                <td class="col-6 cart-total-right  text-right">
                    <span v-if="vmorder.totals.OrderTotal !== null" class="value-summary"><strong>{{vmorder.totals.OrderTotal}}</strong></span>
                    <span v-else>@T("ShoppingCart.Totals.CalculatedDuringCheckout")</span>
                </td>
            </tr>
            <tr v-if="vmorder.totals.WillEarnRewardPoints > 0" class="col-12 px-0 earn-reward-points d-flex justify-content-start">
                <td class="col-6 cart-total-left">
                    <span>@T("ShoppingCart.Totals.RewardPoints.WillEarn"):</span>
                </td>
                <td class="col-6 cart-total-right text-right">
                    <span class="value-summary">@T("ShoppingCart.Totals.RewardPoints.WillEarn.Point").Text.Replace("{0}", "{{vmorder.totals.WillEarnRewardPoints}}")</span>
                </td>
            </tr>
        </tbody>
    </table>
</div>